###
#Load Data and Packages
###
library(lfe)
library(stargazer)

load('house.supplement.mechanisms.RData')

###
#Relating Local Media Market to Awareness of House Member Voting Record
###

rollcall.correct <- felm( share.correct.rep  ~ congruence  + factor(party.alignment) + factor(gender) + factor(race) + factor(income) + factor(education) + population.logged + female.share + black.share + under20.share + over65.share + log.density + log.median.household.income + share.11.education + share.12.education + share.more.education | state.district.year | 0 | state.district.year,data=house.supplement.mechanisms)
rollcall.wrong <- felm( share.wrong.rep  ~ congruence + factor(party.alignment) + factor(gender) + factor(race) + factor(income) + factor(education) + population.logged + female.share + black.share + under20.share + over65.share + log.density + log.median.household.income + share.11.education + share.12.education + share.more.education | state.district.year | 0 | state.district.year,data=house.supplement.mechanisms)
rollcall.dk <- felm( share.dk.rep  ~ congruence + factor(party.alignment) + factor(gender) + factor(race) + factor(income) + factor(education) + population.logged + female.share + black.share + under20.share + over65.share + log.density + log.median.household.income + share.11.education + share.12.education + share.more.education | state.district.year | 0 | state.district.year,data=house.supplement.mechanisms)

#Table B2 - Appendix
stargazer(rollcall.correct,rollcall.wrong,rollcall.dk,keep=c('congruence'),column.labels=c("Correct","Incorrect","Don't Know"),covariate.labels=c('Congruence'),notes=c('District Fixed Effects','Individual and County Controls','Robust Standard Errors, Clustered by District'),star.cutoffs=c(0.05),notes.align='l',digits=2)
